Skip to content

Conversation

@machavan
Copy link
Contributor

@machavan machavan commented Dec 12, 2024

Description:

Calls to MSAL authentication library done from the Java driver code use future.get(), potentially leading to hangs in case the library does not receive timely response from the server. All these calls done as part of getFedAuthToken need to have timeouts imposed. The timeout period is calculated based on remaining time wrt login timeout, and passed to future.get(, ) calls with this fix.

Tests:

  • Existing unit tests pass on local build
  • All ADO tests passed
  • Added new tests

@codecov
Copy link

codecov bot commented Dec 12, 2024

Codecov Report

Attention: Patch coverage is 16.27907% with 36 lines in your changes missing coverage. Please review.

Project coverage is 51.14%. Comparing base (6829848) to head (9051847).

Files with missing lines Patch % Lines
...microsoft/sqlserver/jdbc/SQLServerMSAL4JUtils.java 15.78% 31 Missing and 1 partial ⚠️
.../microsoft/sqlserver/jdbc/SQLServerConnection.java 25.00% 3 Missing ⚠️
...osoft/sqlserver/jdbc/SQLServerSecurityUtility.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2562      +/-   ##
============================================
+ Coverage     51.03%   51.14%   +0.10%     
- Complexity     3919     3927       +8     
============================================
  Files           147      147              
  Lines         33456    33478      +22     
  Branches       5604     5609       +5     
============================================
+ Hits          17074    17122      +48     
+ Misses        13971    13943      -28     
- Partials       2411     2413       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lilgreenbird lilgreenbird added this to the 12.10.0 milestone Dec 16, 2024
- Replaced lock with tryLock to avoid potential long waiting for other
  threads while one thread is taking long to complete.
- Added detailed comment for the usage of semaphore.
divang
divang previously approved these changes Jan 8, 2025
divang
divang previously approved these changes Jan 13, 2025
@machavan machavan merged commit 2a3d372 into main Jan 15, 2025
3 checks passed
@Jeffery-Wasty Jeffery-Wasty deleted the dev/machavan/ado#33039 branch February 11, 2025 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed/Merged PRs

Development

Successfully merging this pull request may close these issues.